package com.ruoyi.cs.service.impl;


import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.cs.domain.TRedbagOpen;
import com.ruoyi.cs.mapper.TRedbagOpenMapper;
import com.ruoyi.cs.service.ITRedbagOpenService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 红包开启记录Service业务层处理
 * 
 * @author ruoyi
 * @date 2021-03-25
 */
@Service
public class TRedbagOpenServiceImpl implements ITRedbagOpenService
{
    @Autowired
    private TRedbagOpenMapper tRedbagOpenMapper;

    /**
     * 查询红包开启记录
     * 
     * @param redbagKqId 红包开启记录ID
     * @return 红包开启记录
     */
    @Override
    public TRedbagOpen selectTRedbagOpenById(String redbagKqId)
    {
        return tRedbagOpenMapper.selectTRedbagOpenById(redbagKqId);
    }

    /**
     * 查询红包开启记录列表
     * 
     * @param tRedbagOpen 红包开启记录
     * @return 红包开启记录
     */
    @Override
    public List<TRedbagOpen> selectTRedbagOpenList(TRedbagOpen tRedbagOpen)
    {
        return tRedbagOpenMapper.selectTRedbagOpenList(tRedbagOpen);
    }

    /**
     * 新增红包开启记录
     * 
     * @param tRedbagOpen 红包开启记录
     * @return 结果
     */
    @Override
    public int insertTRedbagOpen(TRedbagOpen tRedbagOpen)
    {
        tRedbagOpen.setCreateTime(DateUtils.getNowDate());
        return tRedbagOpenMapper.insertTRedbagOpen(tRedbagOpen);
    }

    /**
     * 修改红包开启记录
     * 
     * @param tRedbagOpen 红包开启记录
     * @return 结果
     */
    @Override
    public int updateTRedbagOpen(TRedbagOpen tRedbagOpen)
    {
        tRedbagOpen.setUpdateTime(DateUtils.getNowDate());
        return tRedbagOpenMapper.updateTRedbagOpen(tRedbagOpen);
    }

    /**
     * 批量删除红包开启记录
     * 
     * @param redbagKqIds 需要删除的红包开启记录ID
     * @return 结果
     */
    @Override
    public int deleteTRedbagOpenByIds(String[] redbagKqIds)
    {
        return tRedbagOpenMapper.deleteTRedbagOpenByIds(redbagKqIds);
    }

    /**
     * 删除红包开启记录信息
     * 
     * @param redbagKqId 红包开启记录ID
     * @return 结果
     */
    @Override
    public int deleteTRedbagOpenById(String redbagKqId)
    {
        return tRedbagOpenMapper.deleteTRedbagOpenById(redbagKqId);
    }
}
